#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main()
{
	long long sum = 0;
	int n;
	while (cin >> n)
	{
		vector<int>a;
		a.resize(3 * n);

		for (int i = 0; i < (3 * n); i++)
		{
			cin >> a[i];
		}
       //先排序然后获取下标
		std::sort(a.begin(), a.end());
		for (int i = 0; i < n; i++)
		{
			sum += a[a.size() - 2 * (i + 1)];
		}
		cout << sum << endl;
	}

	return 0;
}